<#include "../common/pagebyform.ftl"/>
<!-- dialog -->
<link rel="stylesheet" type="text/css" href="${base}/js/dialog/dialog.css">
<link rel="stylesheet" type="text/css" href="${base}/js/dialog/productdialog.css">
<SCRIPT type='text/javascript' src="${base}/js/dialog/dialog.js"></SCRIPT>

<!-- pnotify -->
<SCRIPT type='text/javascript' src="${base}/js/pnotify/pnotifymin.js"></SCRIPT>
<link rel="stylesheet" type="text/css" href="${base}/js/pnotify/1.css">
<!-- <link rel="stylesheet" type="text/css" href="${base}/js/pnotify/2.css"> -->
<link rel="stylesheet" type="text/css" href="${base}/js/pnotify/pnotify_default.css">
<link rel="stylesheet" type="text/css" href="${base}/js/pnotify/pnotify_default_icons.css">

<SCRIPT type='text/javascript' src="${base}/js/common/commonUtil.js"></SCRIPT>
<script type="text/javascript">

	var j = jQuery.noConflict();
	j.pnotify.defaults.delay = 6000;
	
	j(function(){
		<#if backUser?exists>
			j.pnotify({
		    	 title: "<span style='font-size: 20px'>${control?if_exists}用户成功</span>",
		    	 text: "<span style='font-size: 15px'>用户名:${backUser.loginName}<br/>用户昵称:${backUser.nickname}<br/>用户编号:${backUser.backuserNo}</span>",
		    	 type: "success",
		         animation: "show",
		         sticker: false,
		         closer: true
		     }).click(function(e){
		    	 j(this).fadeOut("1000"); 
		     });
		</#if>	
	})
	
	function addNewBackUser(){
		dialog("新增用户","iframe:${base}/go/addBackUser.action?backURL=${action.getBackURL2('UTF-8')}","700px","450px","iframe");
	}
	
	function editBackUser(id){
		dialog("编辑用户","iframe:${base}/go/editBackUser.action?backURL=${action.getBackURL2('UTF-8')}&backUser.id="+id,"700px","450px","iframe");
	}
	
	function addNewUserSuccess(newBackUser,control){
		alert(control+"成功");
		if(newBackUser!=null){
			goURL("backUserManage.action?backUser.loginName="+newBackUser.loginName+"&backUser.nickname="+newBackUser.nickname+"&backUser.backuserNo="+newBackUser.backuserNo+"&control="+control)
		}else{
			goURL("backUserManage.action?control="+control)
		}
		
	}
	
	function editBackUserRole(id){
		dialog("设置角色","iframe:${base}/go/editBackUserRole.action?backURL=${action.getBackURL2('UTF-8')}&backUser.id="+id,"700px","450px","iframe");
	}
	
	function formSubmit(){
		j("#firstResult").val("0");
		j("#currPage").val("1");
		j("#searchForm").submit();
	}
</script>

<div class="container">
	<div class="masage_tittle"><h3>用户管理</h3></div>
	<div>
		<form  action="backUserManage.action" method="POST"  id="searchForm" name="searchForm"><br>
			<p class="sdamin_1">用户编号：</p><input class="Text_01" type="text"  name="backUserCondition.backuserNo" <#if backUserCondition?exists>value="${backUserCondition.backuserNo?if_exists}"</#if>/>&nbsp;&nbsp;
			<p class="sdamin_1">用户昵称：</p><input class="Text_01" type="text"  name="backUserCondition.nickname" <#if backUserCondition?exists>value="${backUserCondition.nickname?if_exists}"</#if>/>
			<div class="clear"></div>
			<p class="sdamin_1" style="margin-top: 11px">
				<input type="button" style="background: url('${base}/images/button/ls05.gif');width: 53px;height: 22px;cursor: pointer;border:0 none" value="" onclick="formSubmit()">
				<input type="button" style="background: url('${base}/images/button/ls06.gif');width: 53px;height: 22px;cursor: pointer;border:0 none" value="" onclick="clearTree()">
			</p>
		</form>
	</div><div class="clear"></div>

	<div class="submenu">
		<img src="${base}/images/button/xinzeng.gif" style="cursor: pointer;" onclick="addNewBackUser()">
		<table class="tb tb2"  width="100%">
			<tr class="header" >
				<th style="border:#0099CC solid 1px;" width="20%">操作</th>	
				<th style="border:#0099CC solid 1px;">用户编号</th>
				<th style="border:#0099CC solid 1px;">用户昵称</th>
				<th style="border:#0099CC solid 1px;">创建时间</th>
				<th style="border:#0099CC solid 1px;">用户状态</th>
			</tr>
			<#if backUsers?exists && backUsers?size gt 0>
				<#list backUsers as backUser>
					<tr class="tabletxt">
						<th><input type="button" value="编辑" onclick="editBackUser(${backUser.id?if_exists})">&nbsp;<input type="button" value="设置角色" onclick="editBackUserRole(${backUser.id?if_exists})"></th>
						<th>${backUser.backuserNo?if_exists}</th>
						<th>${backUser.nickname?if_exists}</th>
						<th>${backUser.createTime?string("yyyy-MM-dd HH:mm:ss")}</th>	
						<th>${backUser.status.getCaption()}</th>	
					</tr>
				</#list>	
			</#if>
			<tr>
				<th colspan="5">
					<@page recordCount=count?int pageSize=10 formId="searchForm"/>
				</th>
			<tr>
		</table>
	</div>



</div>